'use strict';

const usage = process.memoryUsage();
console.log('process.memoryUsage()', usage);
/* rss 除了堆内存，还包括堆外内存，例如Buffer占用的内存。 */
console.log('总占用 rss resident set size', usage.rss);
console.log('申请堆内存 heapTotal', usage.heapTotal);
console.log('使用堆内存 heapUsed', usage.heapUsed);
console.log('V8引擎占用 external', usage.external);

console.log('');

const os = require('os');
console.log('os.totalmem()', os.totalmem());
console.log('os.freemem()', os.freemem());
